import random

boxSize = 25

for i in range(100):
    ball = self.makeObject('ball')
    ball.runAction('physics/SphereBody')
    ball.runAction('gfx/prims/SphereMesh')
    
    ball.setVar('position',Vector3(random.uniform(-boxSize,boxSize),random.uniform(boxSize,boxSize*2),random.uniform(-boxSize,boxSize)))
    ball.setVar("radius",random.uniform(2,4))
